<?php echo View::factory('admin/sys/sys_left')->render(); ?>
<script type="text/javascript" src="/media/js/my_validation.js"></script>
<script>
    $(document).ready(function() {
        var chrvalue = '<label for="chr_value" class="lable_title" >参数值<span class="req">*</span></label>';
        $('#chr_value').html(chrvalue +'<input name="chr_value" id="chr_value" class="text medium required"  value=""/>');
        
        $("input[name]=chr_type").click(function() {
            if($(this).is(':checked')){
                if($(this).val() == 'strings') {
                    $('#chr_value').html(chrvalue +'<textarea name="chr_value" id="chr_value" class="textarea required" style="width:500px;height:100px;"></textarea>');
                } else if($(this).val() == 'bool') {
                    $('#chr_value').html(chrvalue +'<input class="radio" type="radio" checked="checked" value="1" name="chr_value">'+
                        '<label class="choice">是</label><input class="radio" type="radio" value="0" name="chr_value">'+
                        '<label class="choice">否</label>');
                } else {
                    $('#chr_value').html(chrvalue +'<input name="chr_value" id="chr_value" class="text medium required"  value=""/>');
                }
            }
        });
    });
</script>


<div id="do_right" class="catalog_right">
    <div class="box" style="overflow:hidden;">
        <h3 id="h3_left">地区管理</h3>
        <div class="clear"></div>

        <div id="tabs">
            <ul>
                <li><a href="#tabs-1">地区管理</a></li>

            </ul>
            <!--START tabs-1 -->
            <div id="tabs-1">
                <ul>
                    <li>

                       <div id="catalogid">
                            <span>分类列表<a id="catalog_tree_collapse_expand" href="#">收起所有</a></span>                           
                            <?php echo $catalog_tree; ?>
                        </div>
                        <div style=" float: left;">
                            <form method="post" action="/admin/area/edit/<?php echo $data->id ?>" class="need_validation" id="commentForm">
                                <ul>
                                    <li>
                                        <label for="name" class="lable_title">地区名称<span class="req">*</span></label>
                                        <input name="name" id="name" class="text required" type="text" value="<?php echo $data->name ?>"/>
                                    </li>
                                    <li>
                                        <label for="parentid" class="lable_title">上级</label>
                                        <select class="drop required" name="parentid" id="parentid">
                                            <?php
                                            echo $catalog_opt == '' ? '<option value="0">--ROOT--</option>' : $catalog_opt;
                                            ?>
                                        </select>
                                    </li>
                                    <li>
                                        <label for="name_en" class="lable_title">英文名<span class="req">*</span></label>
                                        <input name="name_en" id="name_en" class="text required " type="text" value="<?php echo $data->name_en ?>"/>
                                    </li>
                                    <li>
                                        <label for="name_index" class="lable_title">首字母<span class="req">*</span></label>
                                        <input name="name_index" id="name_index" class="text required " type="text" value="<?php echo $data->name_index ?>"/>
                                    </li>
                                    <li>
                                        <label for="position" class="lable_title">排序</label>
                                        <input name="position" id="position" class="text" type="text" value="<?php echo $data->position ?>"/>
                                    </li>
                                    <li>
                                        <label for="name_url" class="lable_title">地址栏显示<span class="req">*</span></label>
                                        <input name="name_url" id="name_url" class="text medium required" type="text" value="<?php echo $data->name_url ?>"/>
                                    </li>

                                    <li>
                                        <label for="mapcode" class="lable_title">地图代码</label>
                                        <input name="mapcode" id="mapcode" class="text medium url" type="text" value="<?php echo $data->mapcode ?>"/>
                                    </li>
                                    <li>
                                        <label for="meta_title" class="lable_title">metatitle</label>
                                        <input name="meta_title" id="meta_title" class="text medium"  value="<?php echo $data->meta_title ?>"/>
                                    </li>
                                    <li>
                                        <label for="meta_keywords" class="lable_title">metakeywords</label>
                                        <textarea name="meta_keywords"  id="meta_keywords" class="textarea" style="width:500px;height:100px;"><?php echo $data->meta_keywords ?></textarea>
                                    </li>
                                    <li>
                                        <label for="meta_description" class="lable_title">metadescription</label>
                                        <textarea name="meta_description"  id="meta_description" class="textarea" style="width:500px;height:100px;"><?php echo $data->meta_description ?></textarea>
                                    </li>

                                </ul>
                                <ul>
                                    <li style="text-align: center;">
                                        <input value="修 改" class="button" type="submit"/>
                                    </li>
                                </ul>
                            </form>
                        </div>
                    </li>

                </ul>
                <div style="clear:both;"></div>
            </div>
            <!--END tabs-1 -->
        </div>
    </div>
</div>
